package me.weijing.common.widget;

import me.weijing.common.callback.TextCallback;
import android.R;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.EditText;

public class ChatEditText extends EditText {
    private TextCallback mTextCallback;

    public ChatEditText(Context context) {
        super(context);
    }

    public ChatEditText(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public void setTextCallbackListener(TextCallback mTextCallback) {
        this.mTextCallback = mTextCallback;
    }

    @Override
    public boolean onTextContextMenuItem(int id) {
        if (id == R.id.paste) {
            this.mTextCallback.pasteCallback();
            return true;
        }
        return super.onTextContextMenuItem(id);
    }
    
}
